package com.tom.contants;

import cn.hutool.core.util.StrUtil;
import dev.langchain4j.model.openai.OpenAiChatModel;
import dev.langchain4j.model.openai.OpenAiModelName;
import org.junit.platform.commons.logging.Logger;
import org.junit.platform.commons.logging.LoggerFactory;

import java.time.Duration;
import java.util.Map;

public class Contants {
    private static final Logger logger = LoggerFactory.getLogger(Contants.class);

    public static final String key="demo";

    public static final String baseUrl = "http://langchain4j.dev/demo/openai/v1";

    public static void log(CharSequence template, Map<?, ?> map){
        System.out.println(StrUtil.format(template,map));
    }
    public static void log(String str){
        System.out.println(str);
    }


    public static final OpenAiChatModel openAiChatModel = OpenAiChatModel.withApiKey(key);



    public static final OpenAiChatModel openAiChatModellog = OpenAiChatModel.builder()
            .apiKey(Contants.key)
            .modelName(OpenAiModelName.GPT_3_5_TURBO)
            .temperature(0.3)
            .timeout(Duration.ofSeconds(60))//60秒
            .logRequests(true)
            .logResponses(true)
            .build();

}
